import request from "@/util/request.js";

export function reqGetRolePageList(params) {
    return request({
        url: '/system/role/page',
        method: 'get',
        params
    })
}
export function reqCreateRole(data) {
    return request({
        url: '/system/menu/role/save',
        method: 'post',
        data
    })
}

export function reqUpdateRole(data) {
    return request({
        url: '/system/menu/role/save',
        method: 'put',
        data
    })
}
export function reqDeleteRoleById(id) {
    return request({
        url: '/system/role/' + id,
        method: 'delete',
    })
}

export function reqGetSysRoleListByUserId(userId){
    return request({
        url: '/system/role/list/by/user/' + userId,
        method: 'get',
    })
}
export function reqUserGrantRole(data){
    return request({
        url: '/system/role/grant',
        method: 'post',
        data
    })
}
